var ns;
var app = new Vue({
    el: '#app',
    data: {
        form: {
            UserID: '',
            LoginName: '',
            RealName: '',
            PhoneNumber: '',
            selectlist: [],
        },
    },
    methods: {
        open_savedit:function(){
            var that=this;
            var option={};
            option.UserID=that.form.UserID;
            option.LoginName=that.form.LoginName;
            option.Realname=that.form.RealName;
            option.PhoneNumber=that.form.PhoneNumber;
            option.action='saveuser';
            ns.post(option, function (succeed, data, err) {
                if(succeed){
                    if(data.status){
                        api.toast({
                            msg: data.msg,
                            duration: 2000,
                            location: 'bottom'
                        });
                        api.sendEvent({
                            name:'load_zhanghao'
                        });
                        setTimeout(() => {
                            api.closeWin();
                        }, 500);

                    }else{
                        api.toast({
                            msg: data.msg,
                            duration: 2000,
                            location: 'bottom'
                          });
                    }
           
                  }else{
                   api.toast({
                     msg: err,
                     duration: 2000,
                     location: 'bottom'
                   });
                }
            });
        }





    }
});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    app.form = api.pageParam.item;
    console.log(JSON.stringify(app.form));
};
